using System.Collections.Generic;
using Sustainalytics.Entities;
using Sustainalytics.Synchronization.Validation.Entities.CorporateGovernance;
using Sustainalytics.Synchronization.Validation.ValidationRules.CorporateGovernance;
using Xunit;

namespace Sustainalytics.Synchronization.Validation.Tests
{
    [Trait("Category", "Unit")]

    public class GovernanceMissingScoresRule_should
    {
        private readonly GovernanceMissingScoresRule _sut;

        public GovernanceMissingScoresRule_should()
        {
            var mock = new IndicatorsHashSet { new List<string> { "G.0", "G.1", "G.2" } };

            _sut = new GovernanceMissingScoresRule();
            _sut.SetDependency(mock);
        }

        [Fact]
        public void Return_false_when_company_indicators_list_is_missing_a_score()
        {
            var fake = new GovernanceValidationProfile()
            {
                GovernanceIndicators = new List<GovernanceIndicator>
                                                          {
                                                              new GovernanceIndicator {Number = "G.0"},
                                                              new GovernanceIndicator {Number = "G.1"}
                                                          }
            };
            var result = _sut.IsValid(fake, new GovernanceValidationProfile());
            Assert.False(result);
        }

        [Fact]
        public void Return_true_when_a_company_has__all_indicators_list_is_missing_a_score()
        {
            var fake = new GovernanceValidationProfile()
            {
                GovernanceIndicators =
                                   new List<GovernanceIndicator>
                                       {
                                           new GovernanceIndicator { Number = "G.0" },
                                           new GovernanceIndicator { Number = "G.1" },
                                           new GovernanceIndicator { Number = "G.2" }
                                       }
            };
            var result = _sut.IsValid(fake, new GovernanceValidationProfile());
            Assert.True(result);
        }
    }
}